Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "Rotate Image" operation in the Live Viewer #2016

Closed
wants to merge 3 commits into from

Conversation

MikeSullivan7
Copy link
Collaborator

Issue

Closes #2003

Description

The images in the Live Viewer can now be rotated by 90, 180, or 270 degrees via a right-click menu option. Once selected, this is apply to all images shown in the Live Viewer so the option only needs to be chosen once.
This functionality uses the existing framework in mantidimaging.core.operations.rotate_stack.rotate_stack.py successfully suggesting that other operations could be implemented in the Live Viewer in the future.

image

image

Testing

make check runs successfully but unit tests will be added in the future. Currently no testing exists for the Live Viewer window.

Acceptance Criteria

Load images into the Live Viewer and check that the data is rotated as expected.

Documentation

Will be added in release notes

@MikeSullivan7 MikeSullivan7 self-assigned this Jan 23, 2024
@coveralls
Copy link

coveralls commented Jan 23, 2024

Coverage Status

coverage: 75.559% (-0.1%) from 75.681%
when pulling 6f90f57 on 2003_Live_Viewer_Rotate_Operation
into 6f47823 on main.

self.right_click_menu = self.live_viewer.image.vb.menu
rotate_menu = self.right_click_menu.addMenu(translate("ViewBox", "Rotate Image"))
rotate_angles_group = QActionGroup(self)
rotate_0 = QAction(translate("ViewBox", "0" + u'\N{DEGREE SIGN}'), rotate_angles_group)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we are not using translation anywhere else, I don't think we should start here. (Whether we should make everything translatable is an interesting question).

Also, in python3 it should be fine using the degree symbol in a string.

rotate_0 = QAction(translate("0°"), rotate_angles_group)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I used it as that's how its structured in the ViewBox module so kept it consistent with that. If we start getting a non-english user base then that would be a good question to ask!

@samtygier-stfc
Copy link
Collaborator

Superseded by #2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Live Viewer: Rotate Images
3 participants